#ifndef MAINFRAME_H
#define MAINFRAME_H

//(*Headers(MainFrame)
#include <wx/listctrl.h>
#include <wx/menu.h>
#include <wx/textctrl.h>
#include <wx/button.h>
#include <wx/frame.h>
//*)

#include "Database.h"
#include "Action.h"
#include "Log.h"
#include "GlobalParam.h"

#include "DialogReadHistory.h"
#include "DialogBookStatus.h"
#include "DialogBookInfo.h"
#include "DialogNoteList.h"
#include "DialogReviewList.h"
#include "DialogWebSync.h"
#include "DialogSetDirectory.h"

class MainFrame: public wxFrame
{
	public:

		MainFrame(wxWindow* parent,wxWindowID id=wxID_ANY,const wxPoint& pos=wxDefaultPosition,const wxSize& size=wxDefaultSize);
		virtual ~MainFrame();

		//(*Declarations(MainFrame)
		wxListCtrl* ListCtrl1;
		wxButton* Button4;
		wxButton* Button1;
		wxMenuItem* MenuItem1;
		wxMenu* Menu1;
		wxButton* Button2;
		wxButton* Button10;
		wxButton* Button5;
		wxTextCtrl* TextCtrl2;
		wxTextCtrl* TextCtrl1;
		wxMenuBar* MenuBar1;
		//*)

		wxMenu* MenuFile;
		wxMenu* MenuImport;

	protected:

		//(*Identifiers(MainFrame)
		static const long ID_LISTCTRL1;
		static const long ID_BUTTON1;
		static const long ID_BUTTON2;
		static const long ID_BUTTON5;
		static const long ID_TEXTCTRL1;
		static const long ID_BUTTON10;
		static const long ID_BUTTON4;
		static const long ID_TEXTCTRL2;
		static const long ID_MENUITEM1;
		//*)

	private:
		//(*Handlers(MainFrame)
		void OnPreviousPage(wxCommandEvent& event);
		void OnJumpPage(wxCommandEvent& event);
		void OnNextPage(wxCommandEvent& event);
		void OnStatusClick(wxCommandEvent& event);
		void OnTestImport(wxCommandEvent& event);
		void OnButton5Click(wxCommandEvent& event);
		void OnReadHistory(wxCommandEvent& event);
		void OnButton6Click(wxCommandEvent& event);
		void OnNoteClick(wxCommandEvent& event);
		void OnRiviewClick(wxCommandEvent& event);
		void OnInfoClick(wxCommandEvent& event);
		void OnWebSync(wxCommandEvent& event);
		void OnImportRefresh(wxCommandEvent& event);
		void OnKeywordSearch(wxCommandEvent& event);
		void OnClickSetDirectory(wxCommandEvent& event);
		//*)

    private:
        Database* ThisDatabase;
        Action* ThisAction;

    private:
        DialogBookStatus* DlgStatus;
        DialogBookInfo* DlgInfo;
        DialogNoteList* DlgNoteList;
        DialogReviewList* DlgReviewList;
        DialogReadHistory* DlgHistory;
        DialogWebSync* DlgSync;

    private:
        void RefreshBookList();
        void RefreshPageView();

        void HideAllDialogs();

        void InitListCtrl();
        void ImportRefresh();

		DECLARE_EVENT_TABLE()
};

// IDs for the menu commands
enum
{
    LIST_ABOUT = wxID_ABOUT,
    LIST_QUIT = wxID_EXIT,

    LIST_LIST_VIEW = wxID_HIGHEST,
    LIST_IMPORT,

    LIST_CTRL                   = 1000
};

#endif
